﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
//
using System.Windows.Forms;
using ddcCajamarca.BusinessEntities.AgendaCultural;
using ddcCajamarca.BusinessLogic.AgendaCultural;
using ddcCajamarca.BusinessLogic.AgendaCultural.Service;
using Microsoft.Practices.Unity;
using System.Web.ModelBinding;

namespace ddcCajamarca.Web.AgendaCultural
{
    public partial class GestionarActividadesFrm : System.Web.UI.Page
    {
        #region Dependencias
        [Dependency]
        public ActividadEventoBL ActividadEventoBL { get; set; }

        [Dependency]
        public IEventoBL EventoBL { get; set; }
        #endregion

        protected void Page_Load(object sender, EventArgs e)
        {
            var idEvento = Request.QueryString["idEvento"];
            
            var eventId = Int32.Parse(idEvento);
            var evento = EventoBL.GetEvento(eventId);

            lblEvento.Text = evento.NombreEvento;
        }

        public IEnumerable<ActividadEvento> GetActividadEventos(Int32? id)
        {
            var idEvento = Request.QueryString["idEvento"];
            if (idEvento==null)
            {
                idEvento = "0";
            }

            var ida = Int32.Parse(idEvento);

            return ActividadEventoBL.GetActividadEventoById(ida).AsQueryable();

        }

    }
}